home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kio / davjob.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  4.1 KB  |  128 lines

  1. // -*- c++ -*-
  2. /* This file is part of the KDE libraries
  3.     Copyright (C) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
  4.  
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License as published by the Free Software Foundation; either
  8.     version 2 of the License, or (at your option) any later version.
  9.  
  10.     This library is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  13.     Library General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU Library General Public License
  16.     along with this library; see the file COPYING.LIB.  If not, write to
  17.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  18.     Boston, MA 02110-1301, USA.
  19. */
  20.  
  21. #ifndef __kio_davjob_h__
  22. #define __kio_davjob_h__
  23.  
  24. #include <kurl.h>
  25.  
  26. #include <qobject.h>
  27. #include <qptrlist.h>
  28. #include <qstring.h>
  29. #include <qstringlist.h>
  30. #include <qguardedptr.h>
  31. #include <qdom.h>
  32.  
  33. #include <sys/types.h>
  34. #include <sys/stat.h>
  35.  
  36. #include <kio/jobclasses.h>
  37. #include <kio/global.h>
  38.  
  39. class Observer;
  40. class QTimer;
  41.  
  42. namespace KIO {
  43.  
  44.     class Slave;
  45.     class SlaveInterface;
  46.  
  47.     /**
  48.      * The transfer job pumps data into and/or out of a Slave.
  49.      * Data is sent to the slave on request of the slave ( dataReq).
  50.      * If data coming from the slave can not be handled, the
  51.      * reading of data from the slave should be suspended.
  52.      * @see KIO::davPropFind()
  53.      * @see KIO::davPropPatch()
  54.      * @see KIO::davSearch()
  55.      * @since 3.1
  56.      */
  57.     class KIO_EXPORT DavJob : public TransferJob {
  58.     Q_OBJECT
  59.  
  60.     public:
  61.         /**
  62.      * Use KIO::davPropFind(), KIO::davPropPatch() and
  63.      * KIO::davSearch() to create a new DavJob.
  64.      */
  65.         DavJob(const KURL& url, int method,
  66.                     const QString& request, bool showProgressInfo);
  67.         /**
  68.      * Returns the response as a QDomDocument.
  69.      * @return the response document
  70.      */
  71.     QDomDocument& response() { return m_response; }
  72.  
  73.     protected slots:
  74.         virtual void slotFinished();
  75.         virtual void slotData( const QByteArray &data);
  76.  
  77.     protected:
  78.         bool m_suspended;
  79.         TransferJob *m_subJob;
  80.     private:
  81.     class DavJobPrivate;
  82.     DavJobPrivate *d;
  83.     QString dummy; // kept around for BC reasons
  84.     QDomDocument m_response;
  85.    };
  86.  
  87.    /**
  88.     * Creates a new DavJob that issues a PROPFIND command. PROPFIND retrieves
  89.     * the properties of the resource identified by the given @p url.
  90.     *
  91.     * @param url the URL of the resource
  92.     * @param properties a propfind document that describes the properties that
  93.     *        should be retrieved
  94.     * @param depth the depth of the request. Can be "0", "1" or "infinity"
  95.     * @param showProgressInfo true to show progress information
  96.     * @return the new DavJob
  97.     */
  98.    KIO_EXPORT DavJob* davPropFind( const KURL& url, const QDomDocument& properties, QString depth, bool showProgressInfo=true );
  99.  
  100.    /**
  101.     * Creates a new DavJob that issues a PROPPATCH command. PROPPATCH sets
  102.     * the properties of the resource identified by the given @p url.
  103.     *
  104.     * @param url the URL of the resource
  105.     * @param properties a PROPPACTCH document that describes the properties that
  106.     *        should be modified and its new values
  107.     * @param showProgressInfo true to show progress information
  108.     * @return the new DavJob
  109.     */
  110.    KIO_EXPORT DavJob* davPropPatch( const KURL& url, const QDomDocument& properties, bool showProgressInfo=true );
  111.  
  112.    /**
  113.     * Creates a new DavJob that issues a SEARCH command.
  114.     *
  115.     * @param url the URL of the resource
  116.     * @param nsURI the URI of the search method's qualified name
  117.     * @param qName the local part of the search method's qualified name
  118.     * @param query the search string
  119.     * @param showProgressInfo true to show progress information
  120.     * @return the new DavJob
  121.     */
  122.    KIO_EXPORT DavJob* davSearch( const KURL &url, const QString& nsURI, const QString& qName, const QString& query, bool showProgressInfo=true ); 
  123.  
  124. }
  125.  
  126. #endif
  127.  
  128.